redo stuff
Switched algorithm a bit
Wahhh
Merge branch 'master' into HEAD
not sure
plz fix