finish resample method
remove helper method typeIsArray