moving some functions around