validations and testing added