Weird effect with subdivision surface?

I have a simple cylinder that I applied a subdivision surface modifier to and got a weird effect that I know isn’t right. How do I change it to make it smooth? (and no, setting object to “smooth” under shading in object tools doesn’t fix it)

Make the triangles at the top into quad by combining adjacents. This helps a little bit. Also, add edge loops to the inner and lower edges.

Thank you :slight_smile: