finish Task B: validation and unit testing