Implement ruler from exercise 5.