Added helper method for stack array creation.