added some comments, fixed some naming