added code to implement 3 stacks from a one array