updated delete and print functions to handle function types