add validation and tests