Complete script for runlist generation. Works out of the box,
but should be edited for better functionality & structure.