Removed the main from the function and added comments on the primary function of the source.