corrected typo in original code
updated with benchmarks
changed headers to patch into v3.6 tree