Added examples and logic for issue 28

[Fix #28] See Issue #28 for details.