fixed the algorithm to make it draw the whole maze