Several additions and improvements