made the script more effective when not all the sources are required