This is a much less stupid way to do it (sorry Phil)