fixed diode bugs
new backend implementation