Finished mean method, added median method