adding code together

I started to put the code together and tweaked some things here and
there