code examples from http://betterspecs.org