listener now uses callback

Added a callback function using a closure to implement a counting tick.