restructured, added JS