Modified group counting algorithm- vector instead of single integer.
Allows to keep "movements records" for 5 quantums of time instead of incrementing/ decrementing int