Bringing demo2 code to master