finished Wilson's algo