added some comments and renameed