added some comments and stuff