separated moving average functions into different file