added SAGE code