Revised hw1-prt2.js