Interesting. I added some garlic towards the end of the onions cooking, finished the pasta cooking in the pan with the onions and added the parmesan on top of the dish after serving. Next time I'd consider using a short pasta instead, as I found it hard to evenly distribute the onions among all the spaghetti. I also will probably dice the onions instead of slicing them.