fixes one bug in calcSize that makes it return size 0