adding lots of debugging to find any problems