Moved condition in OptimalSize to enclose entire do-while loop.  Made near duplicate for else clause.