Implemented the auto scaling.