Consolidated JS

Consoldiated some of the JS
Changed some of the names of variables