Optimize ls command

make it threaded
optimize so we work with array and not string functions