Updated script.js to be bit more efficient.