The authors describe a new algorithm for answering a given set of range queries under differential privacy which often achieves substantially lower error than competing methods. Their algorithm satisfies differential privacy by adding noise that is adapted to the input data and to the given query set. They first privately learn a partitioning of the domain into buckets that suit the input data well. Then they privately estimate counts for each bucket, doing so in a manner well-suited for the given query set. Since the performance of the algorithm depends on the input database, they evaluate it on a wide range of real datasets, showing that they can achieve the benefits of data-dependence on both \"Easy\" and \"Hard\" databases.