var name changes; Move calculations outside loop