improved the code tree