#1961: Added wiring code, removed obsolete parameters, simplified mainloop slightly, changed sigmabounds to a matrix