added buildContactsGrid() function.