made some name changes for clarity and added more notes