changing command construction way using join

Old string append is unefficient way of contructing a command line, I changed it to use string's join method.