added JS sorting