More work on the UI form stack sort method.