works for 1-10, but too slow for 1-20