refactor to use stackable array instead of a php array
update tests for stackables