adjust threshold to a percentage value, adding doc