began moving output to func and refactored test framework