Harlan's pull request

I got this mostly working... mostly.