terrible implementation of backtracking all results