finished the function checkIfValid and also created test
did some changes to the funtion checkIfValidInput and the related test