test for failure case
added code examples from slides