minor bugs fixed, wip format output