some code clean up
more debugging