applied changes from demo1 to avalanche src