replaced add2List GUI specific function with lambda which will work in a command line scenario.