Complete decade logic