Corrected example implementation code