remove debugging output, add functionality