added median computation
comments