modularize - revised to group duplicate symbols together in the error output.