Assignment - Function

Comments added to describe the calculations from the variable input
values. Also added comments to the anonymous function describing it’s
operation.