fixed pseudocode to properly work for first half of checkmate, should work but needs to be tested
psuedocode for checkmate all converted into real code ready to be tested