UNFINISHED Port to python 3