Wall of text, should space things out, new line before the if block, new line before logging (makes it more readable).