Got main counter working

(finally!)