Removed some dead code, added some comments in Jun's classes by Jun. NOTE: this change may have created some new bugs not present in the previous commit, more hands-on test needed