added STL-based find median algorithm