tablechecking.js revised