Added method for validating the input
Better validating method
Merge branch 'Working'