AI Code Third Pass

Third pass at AI code. Added some comments to the socre-field function.