maybe store size in int variable as you fetch it at least 3 times.