Attempt at rewriting the script using valid DataTable API calls