added 3rd median