rate.sleep() added at main(), callbacks moved to protected