Some modifications done to include user preferences