commented/cleaned PI decoding's first phase