Improve half of Day3 - script.js

make it halfway through improving code