Sort weights in elements list.