better attributes and writing out to disk