implements getSize method