Modify to use maybe function