slight changes in code