small bugs in output functions - fixed