small changes for mainControl/etc
adds login part (from Jeremy)