my feeble attempt at assignment 6 #6