Moves writing of Makeflow to seperate function