Updated with nick's feedback.