private void selectPiece(Point p)
	{
		chosenPiece=null;
		possibleMoves=null;

		if(!myBoard.isOnBoard(p))//it isn't on the board
		{
			return;//chosenPiece and possible moves should be null
		}

		Piece thePiece = myBoard.getPiece(p);

		if(thePiece==null)
		{
			return;//if the point doesn't have any piece in it, then chosenPiece and possible moves should be null
		}

		if(thePiece.isWhite==whitesTurn)//the piece chosen was the correct color
		{
			chosenPiece=thePiece;
		}else
		{
			return;
		}

		possibleMoves=thePiece.possibleMoves();
		if(thePiece instanceof King)
		{
			if(!thePiece.hasMoved())//the king hasn't moved yet, check if we can castle it
			{
				checkIfCanCastle();
			}
		}

		//check if en passant is a legal move, and if it is, then add it to the list of possible moves
		if(thePiece instanceof Pawn)
		{
			addPossibleEnPassantMoves(p);
		}

	}