Change fast version from macro to function