fixed up some things and simplified