Rough AI Attempt. Very messy, needs for loops.