Created function for input verification