changed str_clean_whitespace implementation to pkoerner's one