fixed algorithm bug - still need to make it a LOT better