reimplement scatter and merge and adjust examples