refactored for coding conventions
game math