Added quit if no solutions are found