some hacking around to get branch copying working (but it works now)