switching from lists of lists to arrays
map display using arrays
heuristic function using arrays
added check for rectangular map