updated to use mike's new autorelations feature