bugfix in precompute