implemented pr #195

This pull request contains code for issue #195