Fixed a problem with the way mean was calculated, added a test to check the result of mean.
Fixed a bug with the way median was calculated