Working version, added term information