problem solved for n=10,001