Own implementation for issue #24