Keep previous optimization, move calculations outside loop