1st draft merge code