Added depth output to write_agefile