Finished functional javascript exercises 1-4