implemented tails and inits functions