refactored glviewer a bit