resolves #12, resolves #13, fixed #14