added examples.js and modified algorithm model