implement getSize method