modified locations and pairs, updated tests