red gate style macro from 5.4