final version of demo2