Revert "Revert "Closed issue #1 #2 #3 #4""

This reverts commit 322523f0b335a8cdc222866fc8ae3664c5fc7e22.