nice version 1 of O(n2)