issue175 inputvalidation

Updated pull-request to implement validation in the input as #175 
Thanks for the input.