Fix algorithm & frontend