updated Function interface. Now creating the thunk class