correct totalSize computation and tests