fixed stack size calculation