added getQuantity method and error checking

Morgan Holmes