Fix typo in algorithm