Added Callback 

Added a parameter to pass a callback function which is applied on each shape