attempt made at full algorithm
working demo with benchmark
working demo with benchmark