Started to add input checking