The `if...else...` is really all I added. the rest is just style