made encoder and stuff