code and graphic for assignment 2