sort list using plain javascript