Changed binary conversion to be more simple for the counter up to 9