Added a rest function