Added new branch function and removed some stuff from merge which will go into a pull request instead.