some adjustment to the code