improves #41
closes #39