resolve #8 #2 #7 

see commit messages