Added a getNumItems method.