Adressed @abergeron comment on copying variable sub and not using it.