validation

Implementation of validation idea from #3 
typo