Go to your Home-Depot type store, and check into the shed building plans they may have there. There are these pieces (forget who makes them), that are made to connect wood for the maximum structural support. Anyway, they have this one piece that makes securing the top a piece of cake. This same company also has some basic plans for a gazebo which is free, the plans make use of alot of their products in building. Although the products are not required.