second attempt at assignment 2