This variant should be easier to read (it was pretty messy before...). The end result stays the same.