added serveral functions, added quotes, ported to python3