Implemeting solution for issue #49
Resolves #49