Added more comments and a small fix