Removed more unnecessary code, added some comments