optionally print all solutions