Change stack to a simple array