only reset buffers when not empty and other small bits of streamlining
update built code
various optimisations
rename variable