Resolved issue #2, mean function working.