Removed unused code and debug print