Extended polyglot.py's functionality