added function to count tripples in db