add size() method and unit tests