Renamed k to j variable