Added acknowledgment of Tom Goldstein's code