adding impossible maze variation, taking care of an empty stack