Issue #8and9

Please check my changes and merge if acceptable