wrote unit and validation tests