Added js & re-organized c