Formatting

Code formatting.
Modifications are in demo.js.
Especially the Fix .cost vs .getCost().
Oh never mind - I see what you are doing with reusing the parameter now