Added Validation and Unit Testing