Updated after code review.