Removed unused code and debugging