Added checklogin and some experimental code