update median to return Double/NaN when provided an empty list