zpt unfolding code