Track drawing and offsetting code