several changes in code