See http://ambur.net/smart.pdf