This method fails checkstyle. It is too long, > 108 lines. I fixed the other checkstyle errors, but this method seemed gnarly.