adding comments to q5 code