Implemented Mode Toggle