Completed hw4.js