refactored get_games.php