some changes and improvements

Please ignore the test.js and .html, they are a temporary sandbox.