Cleaned up the code and added operator- and variable-panel