Refactor of median method to use if then instead of cond