some small changes in code