Added smoothing and lowered memory requirements