Implemented count() and toarray()