sets up prepare_minion func