some naming changes and adding comments