Content update
Additional comments and small fixes on the main function