removed some debug code and commented out code which is no longer needed