Code amended slightly.