py-1.04: adding python3 version of the code