Removed helper functions from header; moved helper function definitions above invocation point.