restructured and simplified a few things