Attempt at making counting more clever.