ENH: assembly in a function