switched some functions around