Switching iterator type to auto