Added throttle function and its test