Added rest, compact, flatten and without functions and their tests