draw output and write a file
started layout code