Wrote adaptive function estimation code + tests