Copyright (c) 2014 Daniel Reznick, released under the MIT license