finished entering counter logic + some cleanup stuff