Modified according to comments given