takes in flags
determines list of contents
deals with 'a' flag