Made some important changes to lib/ directory
Adding preprocessing stages