added comment to median function