added selfcal function
changed loop file - removed a lot of stuff, replaced with functional
calls
so many script and plot updates; trying to add residual plots etc.