bug fix for Algorithms