added some comments. removed extra output.