finished method to generate the form