fixed Issue#1
implemented Issue #2