- rewrite of pronsole.py