creating a class and function for the car