Some adjustments in the code