More work on getting optimal preference selection. Debugging enabled.