Removed old, unused (commented out) code from lines 899 - 928.  You may have to have a look and see if any of this is actually required as I might have missed something (my decision was obviously based on my own understanding of the code, which may be lacking in some aspects).