Added comments on main functions.