Big thanks to Brian Schiller for these rules