added the main javascript