adds new merge algorithm (closes #3)