Initial implementation of triangle counting