Made more cleanups, added comments