The brakes of a car are applied to give it an acceleration of -2m/s^2. The car comes to a stop in 3s. What was its speed when the brakes were applied?