allow encoder to work with multiple inputs