Completed the 'Median of Three' problem