Added merge fucntion