rewrote assignment code and unit tests