code on analysis code, aa228 project 3