implementation of approximation