Fix for spiral of death, added entity depth sort

Beginning to comment stuff so others know how to use this