Change loop variables from integer to int and declare inline