modified move mehtod in car class to handle boundary conditions