Modified the way in which obstacles are generated and tracked.