Added wave handling, and moved loginscreen.