Additions of logic for a smater AI player.
Code cleanup