HW7, Added validations