clean up output; all functions working