working on stack array