doesn't account for ties that need to be settled by suit. works otherwis...

...e, I think.
Hmm it seems your spacing is completely wack. Can you reindent this whole file. In Vim the command would be `gg=G`