add final code of demo-view