Implemented control panel functions. Fixed bugs.