Updates to make Jonas' code run (not sure if they're right).
Merge pull request #2 from tshort/jonas_updates

Updates to make Jonas' code run.