fixes #6
fixes test cases; #6