Removed scanning from main and put into parser, might be minor changes to other files