Adding comment and completed till calculating mg
Further addition
Reorganize file