Fixed delta method, added test function, improved documentation