validation and tests added for time