Changing all the code to python by using pygame library instead