tidy code, plus examples