bug fixed
Fixes #2 #3 #6