Substantially changed begin-middle-end.js.