updating with new evenlySpaced code for faster processing