Clean up and worked on AI code