Updated edit to use variable and cleaned up the JS file.