Changed local variables to use auto.