implemented series counting, unittest for series