add tests and validation functionality