implemented advanced ai for ghosts