staring from scratch; adding code to preprocess string