Updated sample implementation