adding javascript, changes in structure