Fixed the levelValue functionality
TODO: fix the sort renumbering.