Work on encoder, currently returning too little data