moved a few functions around