Added retraction back into the system. Support for ascending/descending priorities.