i restructured like half of your algorithms.

honestly, i haven't seen this much bad code in a few months now.. you also need to do stuff like documentation...