rest functions to rest()refactor
Merge branch 'fix'