public static Game findGameById(Long gameId) {
		Game game = null;
    	PreparedStatement findGame = null;
    	ResultSet rs = null;
    	String selectStatement =			//logic for prepared statement
				 "SELECT * FROM Game WHERE g_id = ?";
    	try{
    		conn = getConnection();
    		findGame = conn.prepareStatement(selectStatement);	//get connection and declare prepared statement
    		findGame.setLong(1, gameId); 		// set input parameter 1
    		rs = findGame.executeQuery(); 					// execute statement
			while(rs.next()) {
				long p1Id = rs.getLong("g_player1");
				long p2Id = rs.getLong("g_player2");
				
				if(p1Id == 0 || p2Id == 0) 
					System.out.println("Error finding players, or I guess p2 can be a computer");
				
				int playersTurn = rs.getInt("g_playersTurn");
				int winnerId = rs.getInt("g_winner");
				Player p1 = findPlayerById(p1Id);
				Player p2 = findPlayerById(p2Id);
				Map<String, ArrayList<Integer>> tiles = Database.getTilesForGame(gameId);
				game  = new Game(p1, p2, tiles,playersTurn, gameId);
				if(p1.getId() == winnerId)
					game.winnerId = 1;
				else if(p2.getId() == winnerId)
					game.winnerId = 2;
				else
					game.winnerId = 0;
			}
       }
       catch (SQLException | ClassNotFoundException s){
           	System.out.println("SQL statement is not executed:");
           	System.out.println(s);
           	if (s instanceof SQLIntegrityConstraintViolationException) {
           		System.out.println("error creating user");
           	}
       }
       finally {
           if (findGame != null) { 
           	try {
           		findGame.close();
				} catch (SQLException e) {
					e.printStackTrace();
				} 
           }
       }
		return game;
	}