Added validation, passing tests