Address issues #20, #19 and #7

Code changes and improvements that address issues #20 , #19, #7.

Please test and review