Created Mean Function

Used code that I wrote in the discussion section.