Resolves issue #5 and also resolves issue #6