finished maze (apart from some strange segfault which I think comes from fact that not closing file)