fixed median declaration