small changes and removed some debug code