Removed the closed encoder. Own solution follows