Added 'toArray' method and callback func to 'clear' method.