Added maze recognition/preprocessing