added pointer usage to stackbasedrray