Removing some unused code, adding some comments