Combined Ian's changes with my UI changes.