working on stopping condition for smalln