Added examples and logic for issue 28

See Issue #28 for details.