Moar changes to algorithms