added the copyright notice and some extra validations