debugged, time for unit-testing