edited to remove latex warnings