Minor changes and performance increases. checkLogin() now returns a boolean. Also some restructoring of code