first peice of code and plots