Fixed broken loop

Also slight changes to layout and UI.