function median()
 {
 declare -a nums=($(cat))
 printf '%s\n' "${nums[@]}" | sort -n | tail -n $((${#nums[@]} / 2 + 1)) | head -n 1
 }