bug fix in precompute.py