Better fix
Logic
Corrected
.
Some cleanup