Added distancedemo.js.  ALMOST works...