Added the implementation and corrected example file