calculate number of solutions
add performance test and improve solution counter algorithm