fixed up some new functions and ran some cleanup