Implemented counting of orbits