finish up all JS code currently needed
Merging