************************************************************************************************************************************************************************************************************ It was fun discovering the ideas toward the optimization here.