lots of code, mash almost done