my attempt at assignment 2