Removing excess code and debug output