A better fix that passes tetsts