Some algorithm errors need to be fixed