We present an algorithm, and a 2D implementation for a fully automatic hp-adaptive strategy for elliptic problems. Given a mesh, the next, optimally refined mesh, is determined by maximizing the rate of decrease of the hp-interpolation error for a reference solution. Numerical results confirm optimal, exponential convergence rates predicted by the theory of hp methods.