updated unity example code