reorganizing a bit, adding more debug options