adding a simple encoder