more cleanup and a search function for buildings