fixes to UI and end conditions