fix to algorithm