Update code with test