Implemented PI control