minor edits
Minor style/performance improvements.
minor fix: explicit cast from size_t to float
Merge branch 'temp' into spatially_varying_kernel