moved swap prototype to helpers.h