fixed  step17 and step18