modified the code