added the rest function

this could solve the requirements in #81

PS: first intention was to name it cdr, since head is car :tongue: