Revert c075c5d..b98dee5

This rolls back to commit c075c5d51a168468994c5e426c1d43dbf879ac0b.
optimized for count(*)

still long way to go according to the requirement in the output