first attempt at week 2 programming assignment