changed 'auto' to 'auto const &' to prevent copying