Minor adjustments made to the code