Implemented the preprocess function.
Removed test case for preprocessing.