Simpify solution of median 3