Definitions of callback functions, previously commented, have now been redefined