Update using.js

fixed issue 1

general code clean-up and bug fixes.