added lots of debugging