Got direct encode working