Pause menu implemented, many bug fixes and optimizations