I rewrote it a bit.