Finished, modulo bugs or minor changes.