implemented crude solution for issue #9;