working on generating routines