SW in linear space