restructured main file to get more input + cleaner