Completed the viewAll function.