removed some debug code and minor cleanup