reorganize main -- work in progress