fixes #1, fixes #2. javascript added and made accessible