- new slope function
- updated demo 4