reorganizing, sketch to parse args
generating the fname in one place
adding compat irange