misc changes to code and almost final version of report