solves issue #10
solves issue #7