Merge function working

- with some helpers though

Change-Id: Ib618f8117770c0749a0541b6f3784334fbf0d2de