made changes to handle branching scaling with screen size