throttle function now takes 3 arguments.