working on depso algorithm