edited js to complement pic changes