More work on the revert query form (almost finished)