added mainctrl and login works among other things