added count and reverse