Rolled back adding global to direction variables