Updated the script, removed database dependency