Issue #43

Improve implementation