fixed a bunch of bugs in counts parsing and implemented counts line output