added padding of x vector in moving-average
fixed a few bugs
testing