update and port of https://code.google.com/p/visicon to python 3