Re-arrangement of algo stuff.