replaced reference types with auto