encoder script