Added the ability to pass a callback function as a single parameter