First version of complete compute.py
to be dubugged.