added lots of loggin statements