Removed redundant code, and stripped out the debugging.