Deleted alt switches, not big enough changes
Optimizations, clarity

Moved some things, eg. put similar variable declarations next to each
other.
Better explained sweep formula.
Changed smoothing from absolute value less than positive to raw value
between negative and positive, uses less memory.