A few minor updates to make this work on my system rather than Edwin's