Mergewaypoints working version