Removed pointless if loop
Formatting to consistency