solved Bakery Challenge problem