Did some analysis and found that 21! takes above 64 bit integers to store hence set the limit to 20 instead.