working main loop, wrote basic skeleton of built-in operator handling