Another attempt at assignment 3