Updated javascript for NND