Median Maintenance Algorithim