trying to get frontier count to work