added specified functionality and tested with test harness