some code modifications