filling in comments and debugging

filling in comments and debugging