sorting, popups and layout