search page code made a bit nicer