Modified according to Andrew's feedback.