Round 3

3rd evolution of the algorithm, currently doesn't separate the arrays
returned form the state array