more intution for recursive encoding