Added Validation and some Tests