polish 1-dimensional example code