commenting and refactoring the code
Revert "commenting and refactoring the code"

This reverts commit 89364c62e3de333b53d51070c05a91a0e4103c5f.
Reverting the revert... and a short bug fix