fix #36
refactoring. use boxes.
Merge branch 'issue-36-5', close #36, close #85.