CA for stack, few extra functions in simulationforstack