repaired nextCar function. Introduced some debugging features and documentation