Incorporated the -a flag functionality