added support for multiple cars, but code is still ugly