Code amended and 'nlme' added to dependencies.