code and graphic for assignment 3