added some comments and removed an unsed method