resolves #12 and #8