fixed some padding behavior in stack_memory
improved docstring examples for stack_memory