some changes of the code