contributed by John Hasbrouck