Added first version of merge
Added more checks