Made changes as suggested in comments.