fixed #9, progress on #10
fixed #9, fixed #10