~ and tag function handling implemented