added count method to stack and queue