Cleaned up code, better access levels, removed several appendices