refactored types, wrote game