m to last element
stacked implementation