My second attempt at completing my assignment