Adding tests and validation