fix tests, update some comments, simplify some variables