remove old code and make precision a parameter of the surface