A study of NOx formation in hydrogen flames