update Demo project

- rand() to index