Added Sherry's code for QEST algorithm.