the function totalBytes is working now.