misc edits
refactor to use DoubleArrays