created habtm relationships. Some style adjustments.