#41 fixed bug
close #33 - tested
#33
#34 fixed bug
close #34