refine ChaCha. still need to change to be compatible.