wrote validate test and code