Autoformatted and altered a few If(...)
I added a TODO:
//TODO: Double Check if then change
Om the only if(...) that MIGHT have altered the actual logic slightly