start of process rules function