Harmony algorithm