more work on confirm and cancel functions