changed some notation to agree with the textbook