updated second pass