* @Post: move the selected piece to the selected location if it is a valid move
	 * @Return: whether the piece actually moved
	 */
	private boolean movePiece(Point p)
	{
		if(possibleMoves==null)
		{
			return false;
		}
		if(possibleMoves.contains(p))//then we move the piece
		{
			if(chosenPiece instanceof King&&Math.abs(chosenPiece.getX()-p.x)==2){//then this is a castling move, we need to move the appropriate rook
				moveCastlingRook(p);

			}
			else if(chosenPiece instanceof Pawn &&Math.abs(chosenPiece.getX()-p.x)==1)//if it is a pawn that is moving diagonally
			{
				if(getPiece(p)==null)//and the location being moved to is empty then it is an en passant, so we have to remove the other pawn
				{
					if(chosenPiece.isWhite())//remove piece below the white piece
					{
						myBoard.removePiece(getPiece(new Point(p.x,p.y-1)));
					}
					else
					{
						myBoard.removePiece(getPiece(new Point(p.x,p.y+1)));
					}
				}
			}
			myBoard.movePiece(chosenPiece, p);
			chosenPiece.wasMoved();
			chosenPiece=null;
			possibleMoves=null;
			//whitesTurn=!whitesTurn;
			return true;
		}else//if the point isn't a possible move, then deselect the piece and remove the possible moves
		{
			chosenPiece = null;
			possibleMoves=null;
			return false;
		}

	}