major update to structure and code to fit present practices