he spent a great deal of time in the study of mathematics and the making of instruments but he did not forget his duty , riding out at night with nourishing food , his medical tools and his remedies , to alleviate the wretchedness of the people .