How do you maintain a flowing conversation?

I made my first called approach with the girl walking. I went up to her and said I made a comment about her shoes and you start talking to me and we started walking together. I asked her where she was headed and she says to the library and I think I made the mistake of saying I was going to go eat but I could study. We found a spot to sit and it was hard to not feel like I was following her but I kept the conversation going by trying to ask things about her. but there are just certain times I wasn't sure what to talk about and it seem like I was just subject jumping from different classes to where she's from. I got her number but only after I stuttered saying we should hang out or study together. I felt my close was bad cuz my conversation wasn't flowing.