implemented and documented mean and med