Better algorithm to calculate the filesize.