Removed a few unused lines, commented some debug lines. Commented some functions.