Using boolean[][] instead of ArrayList<Location>.