minor changes needed
still need to consider when to remove the branch line