Added depth to AI algorithm