Overhauled much of the existing logic to be more streamlined and efficient. Some bugs were fixed in the process, but other new bugs have been introduced and reported as well.