Mostly done. need to deal with newlines.