submitting solution for challenge #4: calculate the median