same output file as scala/java examples