added diagnostic printing and storing approximation results