implemented Sorting directory
implemented X-Sum directory in js