switch back to python3, added a few functions