Finalized formatting
Clearer logic