issue175 inputvalidation

Updated pull-request to implement validation in the input as #175 
Thanks for the comments, I'll change the code accordingly