synced Jake's AI code