fixed compile errors and tweaked printing. added test file to verify my code