Final version of rectifier implementation