psuedocode for median finder