added coordinate class and updated AI