counting object size correctly