condense main method [UNFINISHED]