updated with  median