made the changes required in comments