updated to use new unboxed closures