closes #132
closes #42 and work on #51