Modified according to comments