update demo
add swf
Improved path algorithm