Tidies logic in if statement.
Adds markdown formatting.