This code was tested under Version 2.11.1. Please address any questions about the code to Wei Lin, University of Toronto Prepared July, 2010.