Harmony finding advanced, rewritten to good coding style