algo2: code cleanup