Fixes #7 Fixes #5 Close #4 and Close #2