fixed typos, fixed looping in branch