updated code with autogenerating blerg