Changed white spaces for Tabs.
A few tweaks on the logic.
Changed some logic.