flip encode buffer
use scheme cache