Comment some and reformat for clarity beginFunction.