included edge residual, commented wrapper function, and added an error estimate