solve() returns number of solutions instead of list

fixes out of memory error