median element is calculated