isLegalMoveforPawn method added