Added more comments, fixed some small stuff.