refactoring intersperse to be imperative style since it will be faster