Revert "Revert "changed 2 lines into 1 line conditionals; commented rest of code""

This reverts commit b307f40c01c64be67928247d3785a3d29857dd17.

Revert "changed 2 lines into 1 line conditionals; commented rest of
code"

This reverts commit c78f92a38f567cf76e3722c4dc3991c057384c6e.