added pertag (hopefully)
first working commit woth changes, pertag patch has been added