Replaced stack with darray