add preserve function & remove trailing whitespace

Preserve
  - keeps state