Removed unecessary debug info and cleaned the code