add an imcomplete implementation of median