Added some more constants for readability, added a mouse move in the beginning to prevent possible errors, and changed the main method to start timing functions to improve speed