implement coalesce