Commented and reorganized mod's main class.