mostly done, still need to write section on errors