Fix style
Fix style and use constant references for temporary variables