sorting and watched variable functions working now, need to add them to the main code now