first working version (no graphics)