cleanup main
incorporate resursive merges