added js for previous list counting