main page layout and basic selection logic with search