A login window was added and some bugs(?) fixed