Improves mouse logic