Added validations and more testing