converted to python3, cleaned up for new start