Good merged version. Coalesce still needs to check edge cases