Adding tail functionality