removed some debug statements and cleaned things up a little