second version with code and figures and text files