moved stuff into a header file