implemented the function to check if input has made approprieately