simplified the algorithm

removed unnecessary bullshit. its still a terrible algorithm.