Fixed bug of array overflow

Changed it so a line is only drawn if the heading direction is changed
+-5