added needed end to sma
working padding refactor